# -*- coding: utf-8 -*-
from django import forms
from django.forms import ModelForm, PasswordInput, CharField, FileField, ModelMultipleChoiceField, CheckboxSelectMultiple
from labmin.webapp.models import *


class StudentForm(ModelForm):
    class Meta:
        model = Student

class StudentGroupForm(ModelForm):
    description = CharField(widget=forms.Textarea, label='Opis', required=False)
    students = ModelMultipleChoiceField(widget=CheckboxSelectMultiple, queryset=Student.objects.all(), label='Studenci');
    class Meta:
        model = StudentGroup

class AdminForm(ModelForm):
    service_groups = ModelMultipleChoiceField(queryset=ServiceGroup.objects.all(), label='Grupy usług', required=False);
    student_groups = ModelMultipleChoiceField(queryset=StudentGroup.objects.all(), label='Grupy studentów', required=False);
    password = CharField(widget=PasswordInput, label='Hasło')
    class Meta:
        model = Admin

class ServiceForm(ModelForm):
    description = CharField(widget=forms.Textarea, label='Opis', required=False)
    class Meta:
        model = Service